<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UserWithdraw extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //  `user_id` int(11) NOT NULL COMMENT '用户ID',
        //  `no` varchar(255) NOT NULL COMMENT '提现流水号',
        //  `price` decimal(11,2) NOT NULL COMMENT '提现金额',
        //  `commission` decimal(11,2) NOT NULL COMMENT '提现手续费',
        //  `status` tinyint(1) NOT NULL COMMENT '提现状态，1：已申请，2：提现中，3：提现成功，4：提现失败',
        //  `reason` text NOT NULL COMMENT '提现失败原因',
        Schema::dropIfExists('user_withdrawal');
        Schema::create('user_withdrawal', function (Blueprint $table){
            $table->comment = "用户提现";
            $table->increments('id')->comment("ID");

            $table->integer('user_id')->comment("用户ID");
            $table->string("no")->comment("提现流水号");

            $table->decimal('price',10,2)->comment("提现金额");
            $table->decimal('commission',10,2)->comment("提现手续费");
            $table->tinyInteger("status")->comment("提现状态");
            $table->string("reason")->comment("失败备注")->default('')->nullable();

            $table->integer('create_time')->comment("创建时间");
            $table->integer('update_time')->comment("更新时间");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
